home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / uupc11ys.zip / LIB / UUNDIR.H < prev    next >
C/C++ Source or Header  |  1993-04-10  |  3KB  |  96 lines

  1. #ifndef UUNDIR_H
  2. #define UUNDIR_H
  3.  
  4. #ifdef WIN32
  5. #include <time.h>
  6. #endif
  7.  
  8. /*--------------------------------------------------------------------*/
  9. /*       u u n d i r . h                                              */
  10. /*                                                                    */
  11. /*       UUPC/extended directory search functions                     */
  12. /*--------------------------------------------------------------------*/
  13.  
  14. /*--------------------------------------------------------------------*/
  15. /*       ndir.h for MS-DOS by Samuel Lam <skl@van-bc.UUCP>, June/87   */
  16. /*--------------------------------------------------------------------*/
  17.  
  18. /*--------------------------------------------------------------------*/
  19. /*    Changes Copyright (c) 1989-1993 by Kendra Electronic            */
  20. /*    Wonderworks.                                                    */
  21. /*                                                                    */
  22. /*    All rights reserved except those explicitly granted by the      */
  23. /*    UUPC/extended license agreement.                                */
  24. /*--------------------------------------------------------------------*/
  25.  
  26. /*--------------------------------------------------------------------*/
  27. /*                          RCS Information                           */
  28. /*--------------------------------------------------------------------*/
  29.  
  30. /*
  31.  *    $Id: UUNDIR.H 1.3 1993/04/10 21:35:30 dmwatt Exp $
  32.  *
  33.  *    Revision history:
  34.  *    $Log: UUNDIR.H $
  35.  *     Revision 1.3  1993/04/10  21:35:30  dmwatt
  36.  *     Windows/NT fixes
  37.  *
  38.  *     Revision 1.2  1993/04/05  04:38:55  ahd
  39.  *     Add time stamp/size information
  40.  *
  41.  */
  42.  
  43. #define MSDOS_MAXNAMLEN 12
  44.  
  45. #define MAXNAMLEN FILENAME_MAX   // For OS/2, Win/NT compatability
  46.  
  47. struct direct {
  48.    long d_ino;
  49.    time_t d_modified;
  50.    long  d_size;
  51.    short d_reclen;
  52.    short d_namlen;
  53.    char d_name[MAXNAMLEN];
  54. };
  55.  
  56. #ifndef FAMILY_API
  57. typedef struct _FTIME           /* ftime */
  58.         {
  59.         unsigned short   twosecs : 5;
  60.         unsigned short   minutes : 6;
  61.         unsigned short   hours   : 5;
  62.         } FTIME;
  63.  
  64. typedef struct _FDATE           /* fdate */
  65.         {
  66.         unsigned short   day     : 5;
  67.         unsigned short   month   : 4;
  68.         unsigned short   year    : 7;
  69.         } FDATE;
  70. #endif
  71.  
  72. typedef struct {
  73.    char filereserved[21];
  74.    char fileattr;
  75.    FTIME filetime;
  76.    FDATE filedate;
  77.    long filesize;
  78.    char filename[MSDOS_MAXNAMLEN + 1];
  79. } DTA;
  80.  
  81. typedef struct {
  82.    char dirid[4];
  83.    struct direct dirent;
  84.    DTA dirdta;
  85.    int dirfirst;
  86. } DIR;
  87.  
  88. extern DIR *opendirx(const char *dirname, char *pattern);
  89.  
  90. #define opendir(x) opendirx(x, "*.*")
  91.  
  92. extern struct direct *readdir(DIR *dirp);
  93. extern void closedir(DIR *dirp);
  94.  
  95. #endif
  96.